<section id="main-body" style='margin-top: 110px;'>
	<div class="container">
		<div class="row">
			<div class="col-md-9 col-sm-12">
				<div class="box-title-page">
					<h4>Events</h4>
				</div><br />
				<div class="row">
					<?php if(isset($results) && !empty($results)): foreach ($results as $event): ?>
						<div class="col-md-4 col-sm-12">
							<div class="box-event-page">
								<div class='image-event'>
									<img class="img-responsive" src="<?php echo site_url('events/appimage/events/'.$event->e_filename); ?>" alt="<?php echo $event->e_origname; ?>">
								</div>
								<div class="caption">
									<?php 
										$find = array(" ",":");
										$name_event = str_replace($find,"-",$event->e_name);
									?>
									<h4><?php echo date("d F, Y", strtotime($event->e_date)); ?></h4>
									<a href="<?php echo site_url('events/detail-events/'.$event->e_id.'/'.$name_event)?>"><h2 style='margin-bottom:1px !important;color:#b9b9b9;font-weight:bold'><?php echo $event->e_name; ?></h2></a>
								</div>
							</div>
						</div>
					<?php endforeach; endif; ?>
				</div>
				<nav>
				    <ul class="pagination">
				    	<?php echo $links; ?>
					</ul>
				</nav>
			</div>

			<div class="col-md-3 col-sm-12">
				<div class="bs-example">
				    <div class="list-group">
				        <a href="#" class="list-group-item active">
				            <span class="glyphicon glyphicon-file"></span> Recent Article
				        </a>
				        <?php if(isset($recent_articles)): foreach ($recent_articles as $articles): ?>
							<a href="<?php echo site_url('articles/detail/'.$articles->a_title.'/'.$articles->a_id); ?>" class="list-group-item">
								<i class="fa fa-gift"></i> <?php echo $articles->a_title; ?>
							</a>	
						<?php endforeach; endif; ?>
				    </div>
				</div>
				<div class="bs-example">
				    <div class="list-group">
				        <a href="#" class="list-group-item active">
				            <span class="glyphicon glyphicon-file"></span> Recent Products
				        </a>
				        <?php if(isset($recent_products)): foreach ($recent_products as $products): ?>
							<a href="<?php echo site_url('products/detail/'.slugify($products->p_name).'/'.$products->p_id); ?>" class="list-group-item">
								<i class="fa fa-gift"></i> <?php echo $products->p_name; ?>
							</a>	
						<?php endforeach; endif; ?>
				    </div>
				</div>
				<div style='margin-top:10px;margin-bottom:10px;'>
					<?php
						if(isset($widget_home)): foreach ($widget_home as $widget): 
							if ($widget->widget_place == 1)	echo $widget->widget_source;
						endforeach; endif; 
					?>
				</div>
			</div>
		</div>
	</div>
</section>

